import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'
import { Modal, Toast } from 'ng-zorro-antd-mobile';
import { FormBuilder } from '@angular/forms';

@Component({
    selector: 'apply-up',
    templateUrl: './apply-up.component.html',
    styleUrls: ['./apply-up.component.scss'],
    providers: [Modal,Toast]
})
export class ApplyUpComponent {
       
    profileForm = this.fb.group({
        money: [''],
        phone: [''],
        code: [''],
      });

    @Input() isShow: boolean = false;
    // @Input() showIndex: any;
    @Output() close = new EventEmitter<any>()
    @Output() show = new EventEmitter<any>()

    state = {
        modal1: false
    };
    footer = [
        {
            text: '确定',
            onPress: () => {
                console.log('确定');

                
                console.log(this.profileForm.value);
                
                this.onClose();
            }
        }
    ];

    constructor(
        private _modal: Modal, 
        private _toast: Toast,
        private fb: FormBuilder
        ) { }

    ngOnint(){
     
    }

    onSubmit(){

    }

    modelChange(event) {
        console.log('asdfasdf', event);
    }
    onClose() {
        this.isShow = false;
        this.close.emit();
    }

    showModal(key) {
        this.state[key] = true;
    }

    
}